package at.ac.univie.zsu.aguataplan.domain;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

/**
 * @author gerry
 * 
 */
@Entity
public class ClubEMail extends EMail {

	@ManyToOne
	private Club refClub;

	// ----------------------------------------------------
	// CONSTRUCTOR
	// ----------------------------------------------------

	public ClubEMail() {

	}

	public ClubEMail(String address) {
		this.address = address;
	}

	// ----------------------------------------------------
	// METHODS
	// ----------------------------------------------------

	public String toString() {
		return this.getAddress();
	}

	public String toStringExtended() {
		StringBuilder sb = new StringBuilder();
		sb.append("Id: ").append(getId()).append(", ");
		sb.append("Address: ").append(getAddress()).append(", ");
		sb.append("Id: ").append(getId()).append(", ");
		sb.append("RefClub: ").append(getRefClub()).append(", ");
		sb.append("Version: ").append(getVersion()).append(", ");
		return sb.toString();
	}

	// ----------------------------------------------------
	// GETTER & SETTER
	// ----------------------------------------------------

	public Club getRefClub() {
		return refClub;
	}

	public void setRefClub(Club refClub) {
		this.refClub = refClub;
	}

}
